﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MovieRental.BuisnessComponents;

namespace MovieRental_Presentation.Helpers
{
    public class ComponentManager
    {
        private static ComponentManager _instance;

        private ComponentManager()
        {
            CustomerComponent = ComponentFactory.Instance.GetCustomerComponent();
            LoanCartComponent = ComponentFactory.Instance.GetLoanCartComponent();
            MovieComponent = ComponentFactory.Instance.GetMovieComponent();
            EditionComponent = ComponentFactory.Instance.GetEditionComponent();
            MediaTypeComponent = ComponentFactory.Instance.GetMediaTypeComponent();
            TemporaryDiscountComponent = ComponentFactory.Instance.GetTemporaryDiscountComponent();
            CartDiscountComponent = ComponentFactory.Instance.GetCartDiscountComponent();
            PersonalDiscountComponent = ComponentFactory.Instance.GetPersonalDiscountComponent();
        }

        public static ComponentManager Instance
        {
            get
            {
                if (_instance == null)
                    _instance = new ComponentManager();
                return _instance;
            }
        }

        public CustomerComponent CustomerComponent { private set; get; }

        public LoanCartComponent LoanCartComponent { private set; get; }

        public MovieComponent MovieComponent { private set; get; }

        public EditionComponent EditionComponent { private set; get; }

        public MediaTypeComponent MediaTypeComponent { private set; get; }

        public TemporaryDiscountComponent TemporaryDiscountComponent { private set; get; }

        public CartDiscountComponent CartDiscountComponent { private set; get; }

        public PersonalDiscountComponent PersonalDiscountComponent { private set; get; }
    }
}
